package com.weapons.week0903_weapons.fragment;


import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.google.gson.Gson;
import com.weapons.week0903_weapons.R;
import com.weapons.week0903_weapons.adapter.ImageRecycleAdapter;
import com.weapons.week0903_weapons.bean.ImageBean;
import com.weapons.week0903_weapons.constant.UrlString;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

/**
 * A simple {@link Fragment} subclass.
 */
public class ImageFragment extends Fragment {
    private Activity mActivity;
    private String mpos="";

    public ImageFragment newInstance(String pos) {
        ImageFragment fragment=new ImageFragment();
        Bundle bundle=new Bundle();
        bundle.putString("pos",pos);
        fragment.setArguments(new Bundle(bundle));
        return fragment;
    }
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mActivity=getActivity();
        Bundle bundle=getArguments();
        if (bundle!=null){
            mpos=bundle.getString("pos");
        }


    }
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_image,container,false);
        return  view;
    }
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);


    }
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }

}
